<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Virtual list</title>
    <style>
        .v-list{
            height: 600px;
            width:100%;
            border: 1px salmon solid;
        }
        .v-list div{
            border: 1px solid #fe007f;
        }
    </style>
</head>

<body>
    <div id="demo">
        <virtual-list class="v-list" :list="listData" :estimate-height="45"></virtual-list>
    </div>
    <script src="./fake-data/faker.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="./JS/virtual-list-vue.js"></script>
    <script>
        // 测试数据，渲染十万条
        const listData = [];
        for (let i = 0; i < 1000; i++) {
            listData.push(faker.lorem.sentences());
        }
        // 安装插件
        Vue.use(virtualListPlugin,{
            useFrameOptimize:true
        });
        new Vue({
            el:'#demo',
            data(){
                return {
                    listData
                }
            }
        })

        

    </script>
</body>

</html>